In a microprocessor-based system used in a mobile device, a main system clock is typically used to synchronize the operation of various circuits within the mobile device with each other. The main system clock is also typically synchronized with the mobile device's communication network. Typically, the main system clock consumes a large amount of device power, shortening the battery life of the mobile device. To conserve battery life, the mobile device may enter a sleep mode when not in use. In sleep mode, the main system clock is temporarily disabled. The time reference for the device may be switched to another clock that runs at a lower frequency and hence consumes less power than the main system clock.
The real time clock typically has lower accuracy and may be sensitive to the operating temperature. To correct this fluctuation, the real time clock is typically calibrated against a reference frequency, such as the main system clock, periodically. This calibration may provide an estimation of the expected drift of the real time clock during the sleep mode of the main system clock. However, there might be a significant temperature change between the time at which the drift estimation for the calibration is performed and the time that the drift is actually corrected using the estimation. This may result in an incorrect estimation of the time elapsed at the end of the sleep period, which may result in incorrect synchronization between the device and the network.
It would be desirable to provide a way to calibrate the real time clock, taking into account such temperature fluctuations.
It will be noted that throughout the appended drawings, like features are identified by like reference numerals.